<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});

Route::any('login/code', 'LoginController@code');   //获取验证码
Route::any('login/login', 'LoginController@login');  //登录验证,没有用户默认注册
Route::any('login/orderlist', 'LoginController@orderlist');  //开发票页面完成订单列表

Route::group([
   'middleware' => 'jwt.api.auth',
    // 'prefix' => 'Chauffeur'

], function () {
	Route::any('login/userinfo', 'LoginController@userinfo'); //个人中心以及侧边栏页面赋值
	Route::any('login/edit', 'LoginController@edit'); //编辑资料页面赋值
	Route::any('login/userinfo', 'LoginController@userinfo'); //编辑资料提交
	Route::any('login/edit', 'LoginController@edit'); //编辑资料页面赋值
	Route::any('login/post_edit', 'LoginController@post_edit'); //编辑资料提交
	Route::any('login/complaints', 'LoginController@complaints'); //投诉页面赋值
	Route::any('login/complaints_post', 'LoginController@complaints_post'); //投诉提交
	Route::any('login/mypurse', 'LoginController@mypurse'); //我的钱包页面赋值
	Route::any('login/money', 'LoginController@money'); //余额页面赋值
    Route::any('login/orderlist', 'LoginController@orderlist'); //按行程开发票页面列表
    Route::any('login/fapiao_post', 'LoginController@fapiao_post'); //按行程开发票提交
    Route::any('login/fapiaolist', 'LoginController@fapiaolist'); //已开发票列表
	Route::any('login/set_message', 'LoginController@set_message'); //设置 -> 消息通知开关 1开 0关
    Route::any('login/loginout', 'LoginController@loginout'); //退出登录
    Route::any('pay/WeiXinAppPay','PayController@WeiXinAppPay');  //微信app支付发起  需要传参数 : 用户ID=>uid ,充值金额=>money
    // Route::any('pay/wxpayNotify','PayController@wxpayNotify');  //微信app微信回调地址
    Route::any('pay/orderselect','PayController@orderselect');  //微信app手动查询订单状态
    Route::any('pay/ordersave','PayController@ordersave');  //微信app个人充值订单状态更改
});
Route::any('pay/wxpayNotify','PayController@wxpayNotify');  //微信app微信回调地址
#【评价模块】
Route::group([
   // 'middleware' => 'jwt.api.auth',
    'prefix' => 'Finish'

], function () {
    Route::any('index', 'FinishController@index');//完善资料首页
    Route::any('end', 'FinishController@end');//评价完成
    Route::any('over', 'FinishController@over');//已评价
    Route::any('add', 'FinishController@add');//已评价
    Route::any('test', 'FinishController@test');//token
});


Route::group([
    'middleware' => 'jwt.api.auth',
   // 'prefix' => 'Finish'

], function () {
    Route::any('sorder/historyCar', 'SorderController@historyCar');//历史乘车人
    Route::any('sorder/serCity', 'SorderController@serCity');//服务城市
    Route::any('sorder/choseCar', 'SorderController@choseCar');//车系选择
    Route::any('sorder/chargePrice', 'SorderController@chargePrice');//计算价格
    Route::any('sorder/setOrder', 'SorderController@setOrder');//下单
    Route::any('sorder/ali_pay', 'SorderController@ali_pay');//支付宝
   
});

Route::group([
   'middleware' => 'jwt.api.auth',

], function () {
    //订单接口
    Route::any('order/waitreceipt', 'OrderController@waitReceipt');//司机接单
    Route::any('order/orderprocess','OrderController@orderProcess');//订单执行中
    Route::any('order/serverend','OrderController@serverEnd');//结束服务
    Route::any('order/cancelorder','OrderController@cancelOrder');//取消订单
    Route::any('order/orderlist','OrderController@orderList');//订单列表
   
});

